package com.central.scheduler.plugin.task.sql;

import com.alibaba.druid.sql.parser.SQLType;
import com.central.common.enums.PrivilegeType;
import com.central.common.properties.Property;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * @author Tindy
 * @date 2021/12/23
 * @describe
 * Used to contains both prepared sql string and its to-be-bind parameters
 */
public class SqlBinds {
    private final String sql;
    private final Map<Integer, Property> paramsMap;
    private SqlType sqlType;
    private Map<String, Set<PrivilegeType>> needPriveleges=new HashMap<>();


    public SqlBinds(String sql, Map<Integer, Property> paramsMap) {
        this.sql = sql;
        this.paramsMap = paramsMap;
    }

    public String getSql() {
        return sql;
    }

    public Map<Integer, Property> getParamsMap() {
        return paramsMap;
    }

    public SqlType getSqlType() {
        return sqlType;
    }

    public void setSqlType(SqlType sqlType) {
        this.sqlType = sqlType;
    }

    public Map<String, Set<PrivilegeType>> getNeedPriveleges() {
        return needPriveleges;
    }

    public void setNeedPriveleges(Map<String, Set<PrivilegeType>> needPriveleges) {
        this.needPriveleges = needPriveleges;
    }
}

